home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
015a
/
fdate41a.zip
/
FDATE.DOC
< prev
next >
Wrap
Text File
|
1992-01-03
|
35KB
|
887 lines
FDATE Version 4.1a Jan 03, 1992
===================================================================
FDATE: a utility for date manipulation in batch files.
===================================================================
Stephen Ferg 5113 N. 8th Road, Arlington, VA 22205-1201
Voice (703) 525-2241 CompuServe 73377,1157
=======================================================================
Format:
FDATE /Ffunc /Adate /Bdate /Iformat /Oformat /Nnum /Ddayofweek /Pstring
=======================================================================
FDATE PARAMETERS
================
The parameters that are required depend on the function requested.
Parameters that are specified, but not needed, are ignored.
Executing FDATE without any parameters displays a brief help screen.
Parameters can be in any order and upper or lower case.
Note that although format specifications are not case sensitive,
they ARE "text sensitive". If any characters are missing,
added, or mistyped, the format specification will be rejected.
(A common mistake is to enter "/format" instead of "/Fformat".
This mistake can be avoided by using the /Ff function alias.)
/F requests a particular FDATE function
If this parameter is not specified, or is specified incorrectly,
FDATE displays a help screen. If you unexpectedly get the help
screen displayed, you probably have omitted the /F parameter.
/N number of days (always a number)
/A date A (for math functions, a number)
/B date B (for math functions, a number)
/I specifies format of input date(s)
/O specifies format of output date
/L specifies language of output. If omitted, English is assumed.
/Leng English-language output [the default]
/Lfr French-language output
/P specifies a prefix string for the output
This optional parameter may always be specified or omitted.
Prefix string must be enclosed in single or double quotes
EXAMPLE: FDATE /Fformat /Atoday /O"mn zd, ccyy" /P"Today is "
Note that multiple spaces will be removed from a /P paramaeter
string, so formatting of /P strings cannot be controlled using
spaces. To format strings, use periods or ASCII 255 (hex'ff')
as filler.
ERROR HANDLING
==============
If FDATE detects an error:
(1) it will return an errorlevel of 1
(2) its output will be 3 lines:
* the word ERROR
* a DOS batch-file ECHO statement that displays an error message
* a DOS batch-file PAUSE statement
If Fdate output is piped to an environment manipulation utility such
as STRINGS or GET, the environment variable will be set to ERROR.
If Fdate output is redirected to a batch file, which is then
executed to set an environment variable, the batch file will:
* set the environment variable to ERROR,
* ECHO the error message, and
* pause.
Appropriate batch-file code for error checking for FDATE might be:
Fdate [parms]....
if errorlevel 1 echo FDATE ENCOUNTERED AN ERROR
if errorlevel 1 goto endit
SYMBOL CONVENTIONS
==================
The following symbols are used in specifying date formats:
SYMBOL EXAMPLE MEANING
------ ------- -------------------------------------
cc 19 century
yy 85 year
mm 02 month
zm 2 month without leading zero
dd 09 day
zd 9 day without leading zero
mn January month name
mn3 Jan month name, first 3 characters only
dow Tuesday day of week
dow3 Tue day of week, first 3 characters only
dow# 3 day of week as a number (Sunday=1, Monday = 2, etc.)
today is a "pseudodate" representing the current date
t is an alias for the "today" pseudodate
hh:mm 09:05 hours and minutes
ss 09 seconds
PSEUDODATES
===========
t (or today)
can be used with either /A or /B, e.g. /Atoday or /At.
EXAMPLE
rem Get the date that is 90 days from today
FDATE /Fadd /N90 /Atoday /Omm-dd-ccyy
FDATE /Fadd /N90 /At /Omm-dd-ccyy
rem determine if this year is a leapyear
FDATE /Ff /At /OLY
tt when used in place of a 2-digit DD string, will cause
Fdate to use today's day-of-the-month.
Example: FDATE /Ff /Imm-dd-ccyy /A01-tt-1992 /Od1
tt when used in place of a 2-digit MM string, will cause
Fdate to use today's month.
Example: FDATE /Ff /Imm-dd-ccyy /Att-01-1992 /Od1
tt when used in place of a 2-digit YY string, will cause
Fdate to use today's year (CCYY).
Example: FDATE /Ff /Imm-dd-yy /A01-01-tt /Od1
Note that TT can NOT be used for only the YY part of a CCYY
input year. The following, for example, is NOT valid:
Example: FDATE /Ff /Imm-dd-ccyy /A01-01-19tt /Od1
tttt when used in place of a 4-digit CCYY string, will cause
Fdate to use today's year (CCYY).
Example: FDATE /Ff /Imm-dd-ccyy /A01-01-tttt /Od1
EXAMPLES:
Show the first Monday in the second quarter of this year
FDATE /Fw /Iccyymmdd /Atttt0301 /D2 /N1 /Od1 /P"First Monday in QTR#2: "
Show the last Friday on/before the 15th of this month.
FDATE /Fw /Iccyymmdd /Atttttt15 /D6 /N-1 /Od1 /P"Friday before the 15th: "
INPUT FORMATS
=============
FORMAT EXAMPLES DISCUSSION
------ --------- -----------------------------
ccyymmdd 19922002
mm-dd-ccyy 02-20-1992 In an input format specification, the dash
02/20/1992 symbols represent ANY non-numeric symbol.
2/20/1992 Leading zeros need not be present.
mm-dd-yy 02-20-92 In this input format,
02/20/92 cc=19 is assumed if YY is greater than 20
02/20/92 otherwise, cc=20 is assumed
NOTE
If ALL input dates are specified using the "today" pseudodate, (i.e.
/At, /Bt) then it is not necessary to supply an input format using /I.
OUTPUT FORMATS
==============
FORMAT EXAMPLES DISCUSSION
------ --------- -----------------------------
ccyy 1992
ccyymm 199202 useful for triggering monthly processing
ccyymmdd 19920220 useful for putting current date in filename
yymmdd 920220 useful for putting current date in filename
mmdd 0220
dd-mn3-yy 02-Feb-92 CompuServe-style date
In the following formats, months precede days (American style)
------------------------------------------------------------------
mm/dd/ccyy 02/20/1992
mm-dd-ccyy 02-20-1992
zm/zd/ccyy 2/20/1992 no leading zeros in day or month
zm-zd-ccyy 2-20-1992 no leading zeros in day or month
mm/dd/yy 02/20/92
mm-dd-yy 02-20-92
zm/zd/yy 2/20/92 no leading zeros in day or month
zm-zd-yy 2-20-92 no leading zeros in day or month
In the following formats, days precede months (European style)
------------------------------------------------------------------
dd/mm/ccyy 02/20/1992
dd-mm-ccyy 02-20-1992
zd/zm/ccyy 2/20/1992 no leading zeros in day or month
zd-zm-ccyy 2-20-1992 no leading zeros in day or month
dd/mm/yy 02/20/92
dd-mm-yy 02-20-92
zd/zm/yy 2/20/92 no leading zeros in day or month
zd-zm-yy 2-20-92 no leading zeros in day or month
------------------------------------------------------------------
Day-of-the-week output formats
------------------------------------------------------------------
dow# 5 Sunday=1, Monday=2 .... Saturday=7.
dow Thursday name of day of week
Jeudi if /Lfr specified
dow3 Thu first 3 characters of name of day of week
Jeu if /Lfr specified
------------------------------------------------------------------
LY 0 1 if year is a leapyear, otherwise 0.
------------------------------------
365 + this number gives total
number of days in the year.
28 + this number gives total
number of days in February.
------------------------------------
d1 Saturday, February 5, 1992
le Samedi 5 Fevrier 1992 [/Lfr specified]
t1 9:05 pm
HH:MM 09:05 ("Military time") (9:05 am)
21:05 (9:05 pm)
HH:MM:SS 21:05:30
full 9:05 pm on Saturday, February 5, 1992
9:05 pm le Samedi 5 Fevrier 1992 [/Lfr specified]
-----------------------------------------------------------------------
NOTE that the following formats contain embedded spaces. Consequently
they must be enclosed in double quotes. EXAMPLE: /O"mn zd, ccyy".
-----------------------------------------------------------------------
"zd mn ccyy" 5 February 1992
"zd mn, ccyy" 5 February, 1992
"mn3 dd ccyy" Feb 05 1992
"mn3 dd, ccyy" Feb 05, 1992
"mn zd, ccyy" February 5, 1992
"JULIAN" OUTPUT FORMATS
=======================
FORMAT EXAMPLES DISCUSSION
------ --------- -----------------------------
julian 311 BUSINESS "Julian date" expressed as number
of days since January 1 of the same year.
day# 727198 TRUE "Julian date" expressed as number
of days since January 1, 0001.
minute# 33088 "Julian minutes": time expressed as number
of minutes since midnight, January 1, 1990.
second# 633088 "Julian seconds": time expressed as number
of seconds since midnight, January 1, 1990.
----------------------------------------------------------------------
Running FDATE with /O parameter for a "Julian time" produces a
number based on the current time of day and the date in the /A parm.
If, on January 10, 1992 at 2 pm, you run FDATE this way:
FDATE /Ff /Atoday /Ominute#
it will produce the Julian minute for January 10, 1992 at 2 pm.
If, on January 10, 1992 at 2 pm, you run FDATE this way:
FDATE /Ff /A01-15-1992 /Imm-dd-ccyy /Ominute#
it will produce the Julian minute for January 15, 1992 at 2 pm.
----------------------------------------------------------------------
DATE FUNCTIONS
==============
FUNCTION FDATE /Ffunc /Adate /Iformat /Oformat
-------- -------------------------------------------
format this is a synonym for function "f"
f returns /Adate in format specified by /Oformat
Since /Aformat and /Oformat can be different, the FORMAT
function is used to change a date from one format to another.
Because of the wide variety of output formats, the FORMAT
function can also be used to determine the day of week of the
date, whether the date is in a normal or leap year, etc.
EXAMPLES
FDATE /Ff /A19920101 /Iccyymmdd /O"mn zd, ccyy"
FDATE /Ff /Atoday /Od1
FDATE /Fformat /Atoday /Od1
FUNCTION FDATE /Ffunc /Nnumdays /Adate /Iformat /Oformat
-------- -------------------------------------------
add Adds /Ndays to /Adate, produces date in /Oformat format
sub Subtracts /Ndays from /Adate, produces date in /Oformat format
EXAMPLES
FDATE /Fadd /N90 /A01-01-1992 /Imm-dd-ccyy /Od1
FDATE /Fsub /N90 /A01-01-1992 /Imm-dd-ccyy /Od1
FDATE /Fadd /N90 /Atoday /Od1
FUNCTION FDATE /Ffunc /Adate /Bdate /Iformat
-------- -------------------------------------------
comp compares the dates specified on the /A and /B parms.
returns when
LT /A is less than (earlier than) /B
EQ /A is equal to (same as) /B
GT /A is greater than (later than) /B
dif Returns number of days between /Adate and /Bdate
Order of the two dates is not significant.
Note that for DIF, both dates must be in the SAME
format, the input format specified in /Iformat.
If the two dates are not in the same format, reformat one
of the dates using the /Ff function and
a utility like STRINGS or GET.
EXAMPLES
FDATE /Fdif /A01-01-1992 /B11-11-1992 /Imm-dd-ccyy
FDATE /Fdif /A11-11-1992 /B01-01-1992 /Imm-dd-ccyy
FDATE /Fdif /Atoday /B01-01-1992 /Imm-dd-ccyy
FUNCTION FDATE /Ffunc /Adate /Iformat /Oformat /Ddow# /Ndow-count
-------- -------------------------------------------
w W (weekday) function.
This function accepts a date specification in parm /A and
returns the date of the /Nth /Day-of-the-week
before or after /Adate. For example:
If /A specifies November 14, 1992
/D specifies the number for Thursday (i.e., 5)
/N specifies a week count of 3
then /Fw returns the date of the third Thursday after
November 14, 1992. (See full example, below)
Note that /N may be negative. If, in the above example, /N
is specified as -3, then Fdate returns the date of the third
Thursday BEFORE November 14, 1992.
If the date specified on the /A parms falls on the same day
of the week as was specified on the /D parm, then that will
be considered to be the first date meeting that day-of-week
criterion. That is, If November 14, 1992 fell on a
Thursday, and if /N was 1 or -1, then the output date would
be the same as the input date, i.e. November 14, 1992.
The acceptable values for /N (number of weeks) is in
the range of 99..-99. A value of zero (i.e. /N0) is invalid.
EXAMPLES
find date of Thanksgiving (4th Thursday in November) in 1992
FDATE /Fw /A11-01-1992 /Imm-dd-ccyy /D5 /N4 /Od1
returns: Thursday November 26, 1992
find the beginning of the work-week (Monday, 2nd day of week)
AFTER Thanksgiving, 1992
FDATE /Fw /A11-26-1992 /Imm-dd-ccyy /D2 /N1 /Od1
find the beginning of the work-week (Monday, 2nd day of week)
BEFORE Thanksgiving, 1992
FDATE /Fw /A11-26-1992 /Imm-dd-ccyy /D2 /N-1 /Od1
MATH FUNCTIONS
==============
FUNCTION FDATE /Ffunc /Anum /Bnum
-------- -------------------------------------------
#add returns the sum of the integers specified
on the /A and /B parms. Can be used to calculate the
"Julian" minute(second, date) in the future from a given
"Julian" minute(second, date).
#sub (not supported)
no numeric subtraction operation (as such) is supported.
Often, you will find that #dif will do what you want.
#dif is the same as subtraction in which the smaller
number is subtracted from the larger number; it will never
return a negative number. If you really MUST have
subtraction, which might return a negative result, you can
add two numbers, one of which is a negative number.
For example, to subtract 3 from 2:
FDATE /F#add /A2 /B-3 [ returns: -1 ]
#dif returns the difference between the integers specified
on the /A and /B parms. Can be used to calculate the
number of minutes(seconds, days) between two
"Julian" minutes(seconds, dates).
#comp compares the integers specified on the /A and /B parms.
returns when
LT /A is less than /B
EQ /A is equal to /B
GT /A is greater than /B
PUTTING FDATE OUTPUT INTO AN ENVIRONMENT VARIABLE
=================================================
FDATE's output is written to standard output, that is, it is displayed
on the screen. Output can be redirected to a file, or it can piped to
a utility (such as STRINGS or GET) that will put it into an
environment variable.
Manipulating the environment is an incredibly tricky business. There
are questions of the local versus master environment, the version of
DOS you are running, and the environment under which you are running
(DOS, Windows, Carousel). In order to keep FDATE focussed on
date-related issues, I have not attempted to make it put its output
directly into an environment variable.
One way to put FDATE's output into an environment variable is to use
the /P (prefix string) feature to create a DOS "SET" statement,
redirect the output to a batch file, and CALL the batch file.
Since CALL first appeared in DOS 3.3, you will need DOS 3.3 or
greater to use this technique.
FDATE /Ff /Atoday /O"mn zd, ccyy" /P"@SET FDATE=" >JUNKTEMP.BAT
call JUNKTEMP.BAT
del JUNKTEMP.BAT
There are also shareware and public domain utilities that are written
specifically to manipulate environment variables, and do that job very
well. FDATE's output can be put into an environment variable by piping
it to one of these utilities. When piping FDATE output to a utility,
you can prevent the output from being ECHOed to the screen by
redirecting the output to NUL.
EXAMPLE: use STRINGS to put date into DATE1 environment variable
FDATE /Ff /At /Od1 | STRINGS date1= ASK >NUL
-----------------------------------------------------------------
I recommend Bob Stephan's GET and PC Magazine's STRINGS.
As of December 30, 1991, the current version of GET is GET25.ZIP.
On CompuServe, use IBMFF to look for GET*.ZIP in CIS:IBMSYS
GET is also available from the Public Software Library in Houston.
On CompuServe, look for STRING.ZIP in Utilities Lib of ZNT:UTILFORUM
-----------------------------------------------------------------
=======================================================================
EXAMPLE #1
Redirect FDATE output to a file, or to a callable batch file,
or pipe it to STRINGS or GET to store it in an environment variable
=======================================================================
rem display Fdate output on screen
FDATE /Ff /At /Od1 /P"Today is "
rem Redirect FDATE output to a file
FDATE /Ff /At /Od1 /P"Today is " >FDATE.OUT
rem Redirect FDATE output to a callable batch file
FDATE /Ff /Atoday /O"mn zd, ccyy" /P"@SET DATE1=" >JUNKTEMP.BAT
call JUNKTEMP.BAT
del JUNKTEMP.BAT
rem Pipe FDATE output to STRINGS to store it in DATE1 environment var
FDATE /Ff /Atoday /O"mn zd, ccyy" |STRINGS date1= ASK >NUL
rem Pipe FDATE output to GET to store it in DATE1 environment var
FDATE /Ff /Atoday /O"mn zd, ccyy" |GET ZE /Vdate1 >NUL
=======================================================================
EXAMPLE #2
Find the difference (in days) between two dates in different formats
Use GET to put FDATE output into environment variables.
=======================================================================
set date1=05-10-1992
rem reformat date literal into same format as date1
FDATE /Ff /Imm-dd-yy /A05-08-92 /Omm-dd-ccyy | GET ZE /Vdate2>NUL
rem get difference between date1 and date2
FDATE /Fdif /Imm-dd-ccyy /A%date1% /B%date2%| GET ZE /vdiff>NUL
echo The difference is %diff% days.
=======================================================================
EXAMPLE #3
Schedule a program to run at a specified time in the future. Note that
this involves a lot of disk activity because DOS re-reads the batch
file from disk every time it does a GOTO LOOPTOP. If you do this, it
is a good idea to run the batch file from a RAM DISK.
=======================================================================
REM GET CURRENT JULIAN MINUTE AND PUT IN ENVIRONMENT VARIABLE RUNTIME
FDATE /Ff /At /Ominute# |STRINGS RunTime= ASK >NUL
REM ADD 120 MINUTES (2 HOURS) TO ENVIRONMENT VARIABLE RUNTIME
FDATE /F#add /A%RunTime% /B120 |STRINGS RunTime= ASK >NUL
REM LOOP UNTIL NOWTIME HAS REACHED RUNTIME
:LoopTop
FDATE /Ff /At /Ominute# |STRINGS NowTime= ASK >NUL
FDATE /F#comp /A%NowTime% /B%RunTime% |STRINGS TimeComp= ASK >NUL
if (%TimeComp%)==(LT) goto loopTOP
:LoopEnd
echo STARTING EXECUTION OF APPLICATION: [program name]
=======================================================================
EXAMPLE #4
Rename file BACKUP.LOG to a name that contains today's date
=======================================================================
FDATE /Ff /Atoday /Oyymmdd /P"@SET DATE1=" >JUNKTEMP.BAT
call JUNKTEMP.BAT
del JUNKTEMP.BAT
ren BACKUP.LOG BK%DATE1%.LOG
SET DATE1=
=======================================================================
EXAMPLE #4b
Use FDATE to rename a log file to a name that will be unique within a
minute time-frame. This is a way to keep an historical record of a
series of log files. Since the file will retain its original date/time
stamp, you will still be able easily to tell when it was created.
In this example, we use GET to put the FDATE output into
environment variable TEMPVAR.
=======================================================================
FDATE /FF /At /Ominute# | GET ZE /Vtempvar >nul
REN online.log %tempvar%.log
SET tempvar=
=======================================================================
EXAMPLE #5
Find the calendar date corresponding to Julian date 1992:200
by adding 200 to the last day of the previous year.
=======================================================================
FDATE /Fadd /A12-31-1991 /Imm-dd-ccyy /N200 /Od1
=======================================================================
EXAMPLE #6
Check to see if parameter %1 is a valid year (CCYY)
=======================================================================
@echo off
rem determine if value sent in through parameter %1 is a valid year
Fdate /Ff /Imm-dd-ccyy /A01-01-%1 /Od1 >nul
if errorlevel 1 echo Parm 1 was not a valid year: %1
if errorlevel 1 goto endit
echo PUT YOUR BATCH PROCESSING HERE, USING YEAR VALUE OF: %1
:endit
=======================================================================
EXAMPLE #7
Find the 4th Thursday in November (Thanksgiving)
=======================================================================
Fdate /Fw /D5 /N4 /A11-01-%year% /Imm-dd-ccyy /Od1 /P"Thanksgiving: "
=======================================================================
EXAMPLE #8
Show the number of the anniversary for some special event.
=======================================================================
SEE HOLIDAYS.BAT
=======================================================================
EXAMPLE #9
Run a program once a day, when you boot for the first time that day.
=======================================================================
@echo off
cls
REM -------------------------------------------------------------------
REM Run daily processing once a day. Put this code in AUTOEXEC.BAT.
REM This batch file requires DOS 3.3+, since it uses CALL.
REM -------------------------------------------------------------------
if not exist LastRun.BAT goto RunNow
REM LastRun.Bat will set env var LASTRUN to date AUTOEXEC was last run.
call LastRun.BAT
REM Compare today's date to date in LASTRUN
Fdate /Fcomp /Imm-dd-ccyy /At /B%LastRun% /P"@set COMP=">junktemp.BAT
call junktemp.BAT
del junktemp.BAT
IF (%COMP%)==(EQ) goto NoRun
REM if user reset system clock, today's date may be less than LASTRUN
IF (%COMP%)==(LT) goto NoRun
rem Daily processing hasn't been run today. Run it.
echo RUNNING ONCE A DAY PROCESSING: Job 1
echo RUNNING ONCE A DAY PROCESSING: Job 2
echo RUNNING ONCE A DAY PROCESSING: ............. etc.
rem ------------------------------------------------------------------
rem Save today's date in a new version of LastRun.BAT
rem Note that this will be executed only if daily processing runs to
rem completion without hanging the machine or aborting the batch file.
rem ------------------------------------------------------------------
Fdate /Ff /Omm-dd-ccyy /At /P"@set LastRun=">LastRun.BAT
:NoRun
set LastRun=
set COMP=
FDATE'S ALGORITHMS
==================
FDATE IS DESIGNED FOR BUSINESS, NOT HISTORICAL, APPLICATIONS
============================================================
FDATE is intended for business applications, not historical ones.
As far as FDATE is concerned, the calendar has followed the same
pattern, unchanged, since January 1, 0001.
-------------------------------------------------------------------
FDATE does not take into account historical changes in the calendar
such as the glitch in English dates that occurred when Britain
moved from the Julian to Gregorian calendar in the 18th century,
or Russia made the same move in the early 20th century.
-------------------------------------------------------------------
FDATE'S BASE DATE
=================
Internally, date manipulations are based on translating a calendar
date into an "absolute" or "TRUE Julian" date: a date expressed
as the number of days from some day in the distant past.
FDATE's base date is January 1, 0001 (i.e. day 1 of month 1 of year 1)
FDATE's absolute date for January 1, 0001 is 1.
FDATE's absolute date for January 1, 1992 is 727198.
FDATE'S LEAP YEAR ALGORITHM
===========================
Every year evenly divisible by 4 IS a leap year
EXCEPT THAT
Every year evenly divisible by 100 IS NOT a leap year
EXCEPT THAT
Every year evenly divisible by 400 IS a leap year
.
Using this algorithm
1983 is not a leap year
1984 is a leap year
1900 is not a leap year
2000 is a leap year
See "A Machine Algorithm for Processing Calendar Dates", by
Henry F. Fliegel (Georgetown University Observatory) and
Thomas C. Van Flandern (U.S. Naval Observatory)
COMMUNICATIONS OF THE ACM, Volume 11, Number 10, October 1968
There is supposedly a new adjustment to the leapyear algorithm,
which specifies the additional exception:
EXCEPT THAT
Every year evenly divisible by 4000 IS a leap year
See "Bit By Bit" column, COMPUTER LANGUAGE, November 1989, p. 148.
This adjustment is not part of FDATE's leapyear algorithm.
Unless your application is working with dates 2,000 years in the
future, the lack of this exception will be irrelevant for you.
USE AND DISTRIBUTION OF FDATE
=============================
FDATE is freeware. Although the author retains the copyright, FDATE
can be copied, used, and distributed freely as long as both FDATE.EXE
and its associated doc files (FDATE.DOC, FDATEX.BAT, HOLIDAYS.BAT)
are not altered and are distributed together.
FDATE can be included in shareware packages as long as both FDATE and
its doc files are included in the shareware package.
If you have received FDATE as part of some larger shareware package,
please be aware that you may freely use, copy, and distribute FDATE
without paying a fee for, or registering, the package.
The author explicitly disavows any claim whatsoever about the
functionality of the software, and disclaims liability for anything and
everything bad that might happen in connection with, before, during, or
after using it. I have tried to make FDATE work right, but everybody
makes mistakes, so you use FDATE at your own risk.
I don't know if people will find FDATE useful, and I'd like to find
out. If you find FDATE useful and use it on a regular basis, I'd
appreciate it if you would drop me a short note via US mail or
CompuServe, telling me about how you are using FDATE.
If you need other input/output formats, or if you need a different
leapyear algorithm, please contact the author.
UPDATES AND CURRENT VERSION OF FDATE
====================================
You will always be able to find the most recent version of FDATE on
CompuServe. The filename will be FDATE.ZIP, and it will be available in
one of the libraries in the CIS:IBMSYS forum and one of the libraries in
the ZNT:UTILFORUM forum. You can find it by using cross-library
searching, looking for the filename FDATE.ZIP or the keyword FDATE.
Feel free to post copies of FDATE.ZIP on any BBS that you wish, but
please do not upload it to any CompuServe library. As long as I am the
only one putting copies of FDATE onto CompuServe, we can keep confusion
over versions to a minimum.
FDATE REVISION HISTORY
======================
Letters appended to version numbers indicate modifications to
the doc files, without any modification to the FDATE.EXE software.
1.1 Oct 01, 1991
First version of FDATE
1.2 Oct 15, 1991
Replaced shareware date routines with Ferg routines
NOTE THAT THERE IS NOT MUCH ERROR-CHECKING IN THIS VERSION.
1.2d Oct 16, 1991
Minor changes to show redirection and piping of FDATE output
Revised discussion of how FDATE may be distributed.
Added note on business-related, non-historical purpose of FDATE
Added note on 4000-year leap-year exception
1.2e Oct 17, 1991
Added note on why FDATE doesn't directly set an Env variable
2.0a Nov 05, 1991
Modified Help display to show parameters and their meanings
Added output format YYMMDD
Added output format minute# and second#
Added function #dif
Added test of GET and STRINGS to FDATEX.BAT
Added test of minute# and second# to FDATEX.BAT
2.1a Nov 06, 1991
Added /P parameter and modified documentation accordingly
Added JULDATE output format
Minor changes and reformatting to documenation
2.2a Nov 08, 1991
Added example showing how to put current date in a filename
Added MMDD output formats
2.3a Nov 09, 1991
Added /L (language parameter) to allow French-language output
Added the following output formats
full
"mn3 zd, ccyy"
"zd mn, ccyy"
"zd mn ccyy"
European-style date formats
in which day occurs before month (e.g. dd/mm/ccyy)
2.4a Nov 10, 1991
Fixed display of time in /Ofull so that a minutes value of
less than 10 would display with a leading zero:
e.g. "10:08 am" instead of "10:8 am".
2.5a Nov 13, 1991
Added output format CCYYMM
2.6a Nov 25, 1991
Added function "F" (/Ff) as an synonym for /Fformat
Split FDATEX.BAT off from FDATE.DOC into its own file
2.6b Dec 02, 1991
Modified this doc file to reflect new /Ff feature
2.7a Dec 07, 1991
Added CompuServe-style output format: dd-mn3-yy.
Example: 07-Dec-91
2.8a Dec 08, 1991
Added output format d1. Example: Saturday December 7, 1991
Added output format t1. Example: 9:05 am
Added "t" alias for "today" pseudodate.
Corrected FDATE "help" display which had incorrectly shown
dd-mn3-yy as an input (rather than an output) format.
Modified documentation and FDATEX.BAT to reflect software changes.
Extensively re-wrote and re-arranged FDATEX.BAT to make it
more user-friendly.
In documentation:
corrected the formats for European dates, which had incorrectly
been shown as having the same format as American dates.
2.8b Dec 09, 1991
In documentation:
Added example showing how to use fdate to create a
time-stamped filename.
2.9a Dec 26, 1991
Added STRINGS and GET info to HELP screen.
In documentation:
Added example: how to find calendar date of Julian date
3.0a Dec 27, 1991
=============== MAJOR BUG FIX ==============================
Fixed bug in TRUEDATE date arithmetic routine that caused
incorrect dates to be returned for the last 2 or 3 days of
some months.
============================================================
Added output formats ccyy, hh:mm, and hh:mm:ss.
Replaced output format JULDATE with JULIAN
JULDATE retained for compatibility, but not documented.
Modified this doc file and FDATEX.BAT accordingly.
3.1a Dec 28, 1991
Fixed bug: error messages were ignoring the /P parm
added HOLIDAYS.BAT to distribution package
Replaced output format LEAPYR with LY
LEAPYR retained for compatibility, but not documented.
Added new feature: when an error is detected:
output string is "ERROR", and
errorlevel is set to 1.
Changed assumed century on input formats that require only YY.
Now, if year is LT/EQ 20, a century of 20 is assumed.
FDATE will now be able to function nicely until year 2020.
Modified this doc file and FDATEX.BAT accordingly.
3.2a Dec 29, 1991
Added COMP (date compare) function
Added RUN-ONCE-A-DAY example, which uses new COMP function
Added error-trapping for dates before year 1 and after year 9999.
Fixed minor error in HELP screen (dif does NOT require /O).
Modified this doc file and FDATEX.BAT accordingly.
3.2b Dec 30, 1991
Fixed two bugs in this doc file. (Thanks to Luther Schliesser
for the bug report.) My phone number was wrong, and the
values returned by the leapyear function (0,1) were reversed.
Fixed my phone number in the HELP screen.
Minor changes in the examples in this DOC file.
3.2c Dec 31, 1991
Fixed bug in HOLIDAYS.BAT that showed New Year's Eve when
it should have showed New Year's Day.
(Thanks to Luther Schliesser for ANOTHER bug report.)
Modified HOLIDAYS.BAT to show Easter-related holidays 1992-2000
Modified HOLIDAYS.BAT to give an example of calculating
anniversaries for a user-specified "special date" (SD)
4.1a Jan 03, 1992
Added ability to accept TT, TT, and TTTT
as pseudodates for current MM, DD, and CCYY.
Added function: W (i.e. /Fw)
Modified this doc file, FDATEX.BAT, and HOLIDAYS.BAT accordingly.
Modified HOLIDAYS.BAT to use new /Fw to show Thanksgiving.
Added Luther Schliesser's anniversary code to HOLIDAYS.BAT
Added note on elimination of multiple spaces from /P strings.
Added note showing how to use #add and negative number to to
true subtraction.
Added note: UPDATES AND CURRENT VERSION OF FDATE